package com.example.app.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding

abstract class BaseSupportFragment<VB : ViewBinding> : BaseFragment() {

    abstract fun createViewBinding(inflater: LayoutInflater): VB?

    protected var mViewBinding: VB? = null

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        mViewBinding = createViewBinding(inflater)
        return mViewBinding?.root
    }

    override fun onDestroyView() {
        super.onDestroyView()
        mViewBinding = null
    }
}